#!/usr/bin/env python
# coding=utf-8
#
# Copyright (c) [2023] Huawei Technologies Co.,Ltd.All rights reserved.
#
# OpenArkCompiler is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
#
#     http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR
# FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
#

from api import *

CO2_DUMP = {
    "compile": [
        MapleDriver(
            maple="${MAPLE_BUILD_OUTPUT}/bin/maple",
            infiles=["${APP}.c"],
            outfile="${APP}.s",
            include_path=[
                "${MAPLE_BUILD_OUTPUT}/lib/include",
                "${MAPLE_ROOT}/tools/gcc-linaro-7.5.0/aarch64-linux-gnu/libc/usr/include",
                "${MAPLE_ROOT}/tools/gcc-linaro-7.5.0/lib/gcc/aarch64-linux-gnu/7.5.0/include",
                "../lib/include",
                "${MAPLE_ROOT}/testsuite/c_test/csmith_test/runtime_x86"
            ],
            option="-O2 -fPIC -g -lpthread -lm -Wno-error=int-conversion -S --hir2mpl-opt=\"-dump-bb -dump-cfg=* -dump-comment -dump-phase-time -dump-LOC -dump-inst-comment -dump-feir \" --me-opt=\"--dump-phases=* --dump-func=* --dump-after --stmtnum --dumpcfgofphases \" --mpl2mpl-opt=\"--dump-phase=* --dump-func=* --dump-before --dump-after --dump-muid --dump-devirtual-list --dumpo_cl_invocation --dump-ipa \" --mplcg-opt=\"-verbose-cg --dump-olog --dump-func=* --debug-schedule --dump-phases=*,regalloc\"> log.txt"
        )
    ],
    "run": []
}
